package com.ruoyi.system.domain;

import java.util.Date;
import java.util.List;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 告警对象 sys_alarm
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Data
public class SysAlarm extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 告警id */
    private Long alarmId;

    /** 部门id */
    @Excel(name = "部门id")
    private Long deptId;

    /** 设备id */
    @Excel(name = "设备id")
    private Long deviceId;

    /** 告警配置id */
    @Excel(name = "告警配置id")
    private Long alarmConfigId;

    /** 告警类型 1=设备异常 2=设备规则报警 3=原始设备报警 */
    @Excel(name = "告警类型 1=设备异常 2=设备规则报警 3=原始设备报警")
    private String alarmType;

    /** 告警级别 1=一级 2=二级 3=三级 */
    @Excel(name = "告警级别 1=一级 2=二级 3=三级")
    private String alarmLevel;

    /** 告警状态 1=未处理 2=已处理 */
    @Excel(name = "告警状态 1=未处理 2=已处理")
    private String alarmStatus;

    /** 告警内容 */
    @Excel(name = "告警内容")
    private String alarmContent;

    /** 处理内容 */
    @Excel(name = "处理内容")
    private String dealContent;

    /** 上次告警时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上次告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastAlarmTime;

    /** 原始报警内容 */
    private JSONObject resultContent;
    /** 报警匹配字段列表 */
    private JSONArray matchFiled;

    private String alarmName;

    private Integer limit;

    private String address;

    private String buildingNo;
    private Integer unit;
    private Integer floor;
    private Integer door;

    /**
     * 建议
     */
    private String suggestContent;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("alarmId", getAlarmId())
            .append("deptId", getDeptId())
            .append("deviceId", getDeviceId())
            .append("alarmConfigId", getAlarmConfigId())
            .append("alarmType", getAlarmType())
            .append("alarmLevel", getAlarmLevel())
            .append("alarmStatus", getAlarmStatus())
            .append("createTime", getCreateTime())
            .append("alarmContent", getAlarmContent())
            .append("updateTime", getUpdateTime())
            .append("updateBy", getUpdateBy())
            .append("dealContent", getDealContent())
            .append("lastAlarmTime", getLastAlarmTime())
            .toString();
    }
}
